package com.javajavadog.ui.elevation;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;

import com.javajavadog.ui.R;
import com.javajavadog.ui.activitypatterns.PatternListActivity;
import com.javajavadog.ui.activitypatterns.PatternTabActivity;
import com.javajavadog.ui.base.BaseListActivity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ElevationMenuActivity extends BaseListActivity {
    @Override
    public AdapterView.OnItemClickListener getOnItemClickListener() {
        return new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                TextView t = (TextView) view.findViewById(R.id.text_view_list_item);

                if (null == t) {
                    return;
                }

                String item = t.getText().toString();
                Intent intent;
                switch (item) {
                    case "Elevation basic activity":
                        intent = new Intent(ElevationMenuActivity.this, ElevationBasicActivity.class);
                        startActivity(intent);
                        break;
                }
            }
        };
    }

    @Override
    public List<Map<String, String>> getListData() {
        List<Map<String, String>> data = new ArrayList<>();

        Map<String, String> item01 = new HashMap<>();
        item01.put("item_name", "Elevation basic activity");
        item01.put("item_subtitle", "Write item descriptions here");

        data.add(item01);
        return data;
    }

    @Override
    public String getTitleText() {
        return "Elevations";
    }

    @Override
    public boolean enableBackButton() {
        return true;
    }
}
